package br.com.datatraffic.restricao.domain.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Entity @Data @EqualsAndHashCode(exclude = { "restricoes" }) @ToString(exclude = { "restricoes" }) public class TipoRestricao {
	@Id @SequenceGenerator(name = "TIPORESTRICAO_SEQ", sequenceName = "TIPORESTRICAO_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TIPORESTRICAO_SEQ") @Column(name = "TIPO_RESTRICAO_ID", nullable = false) private Long id;
	private String nome;
	private String descricao;
	@OneToMany(mappedBy = "tipoRestricao") private List<Restricao> restricoes = new ArrayList<Restricao>(0);

	public TipoRestricao() {
	}

	public TipoRestricao(Long id) {
		this.id = id;
	}
}
